# -*- mode: snippet -*-
# name: shiny module
# key: shiny.module
# key: shiny_module
# contributor: Shuguang Sun
# --
#' $1 UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList
${1:name}_ui <- function(id){
  ns <- NS(id)
  tagList(

  )
}

#' $1 Server Functions
#'
#' @noRd
$1_server <- function(id){
  moduleServer(id, function(input, output, session) {
    ns <- session$ns

  })
}

## To be copied in the UI
# $1_ui("$1_ui_1")

## To be copied in the server
# $1_server("$1_ui_1")

## shiny < 1.50
${1:name}ui <- function(id) {
    ns <- NS(id)
    tagList(

        )
    }

${1:name} <- function(input, output, session) {
    ns <- session\$ns
}

## Copy in UI
${1:name}ui("${1:name}ui")

## Copy in server
callModule(${1:name}, "${1:name}ui")